home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / SoundAndMusic / cmix / lib / rsnset.c < prev    next >
C/C++ Source or Header  |  1989-02-25  |  388b  |  20 lines

  1.  
  2. #include "../H/ugens.h"
  3. rsnset(cf,bw,scl,xinit,a)
  4. float cf,bw,scl,xinit,*a;
  5. {
  6.     double exp(),cos(),sqrt();
  7.     float c,temp;
  8.     if(!xinit) {
  9.         a[4] = 0;
  10.         a[3] = 0;
  11.         }
  12.     a[2] = exp(-PI2 * bw/SR);
  13.     temp = 1. - a[2];
  14.     c = a[2] + 1;
  15.     a[1] = 4. * a[2]/c * cos(PI2 * cf/SR);
  16.     if(scl < 0) a[0] = 1;
  17.     if(scl) a[0] = sqrt(temp/c*(c*c-a[1]*a[1]));
  18.     if(!scl) a[0] = temp*sqrt(1.-a[1]*a[1]/(4.*a[2]));
  19. }
  20.